package cn.edu.scau.cmi.dengzejun.chapter05;

public class Geometry {
	Rectangle rect;
	Circle circle;
	
	Geometry(Rectangle rect,Circle circle){
		this.rect=rect;
		this.circle=circle;
		return;
	}
	
	public void SetCirclePosition(double x,double y) {
		circle.SetX(x);
		circle.SetY(y);
		return;
	}
	
	public void SetCircleRadius(double r) {
		circle.SetRadius(r);
		return;
	}
	
	public void SetRectanglePositon(double x,double y) {
		rect.SetX(x);
		rect.SetY(y);
		return;
	}
	
	public void SetRectanglePosion(double w,double h) {
		rect.SetWidth(w);
		rect.SetHeight(h);
		return;
	}
	
	public void SetRectangleWidthAndHeight(double w,double h) {
		rect.SetWidth(w);
		rect.SetHeight(h);
		return;
	}
	
	public void ShowState() {
		if (rect.GetX()-rect.GetWidth()>=circle.GetX()+circle.GetRadius()) {
			System.out.println("The rectangle is on the circle right");
		}
		if (rect.GetX()+rect.GetWidth()<=circle.GetX()-circle.GetRadius()) {
			System.out.println("The rectangle is on the circle left");
		}
		return;
	}
}
